const host = 'http://www.doctorsclass.com';

axios.interceptors.request.use(config => {
    config.headers.token = localStorage.getItem("token")
    //config.headers.token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MDUwODcyNDgsImlkIjoyNCwidCI6Im1wIn0.-I43AGI7OFG50N0xw8q9U2ArUonVDw6KtNIz80r2_NE"
    // config.headers['X-Requested-With'] = 'XMLHttpRequest'
    //统一配置域名
    config.baseURL = host
    return config
})
axios.interceptors.response.use(res => {
    return res
}, (err) => {
    if (err.response.status === 511) {
        window.location.href = host + '/mp/open/auth'
    }
    return Promise.reject(err);
})
